import { Controller } from "../../mvc/core/Controller";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { EventName } from "../mvc/EventName";
import { DataEvent } from "../events/DataEvent";
import { SoundManager } from "../../common/sound/SoundManager";
import { MapFileUtil } from "../scene/map/MapFileUtil";
import { SoundTypeConst } from "../../common/sound/SoundTypeConst";
//class MusicAndSoundsController
    
    export  class MusicAndSoundsController extends Controller
    {
       

        protected /* override */ initServer(): void
        {
            Dispatcher.addEventListener(EventName.ChangeScene, this.onChangeSceneHandler);
            return;
        }

        /* internal  */onChangeSceneHandler(arg1: DataEvent): void
        {
            SoundManager.instance.setBackGroundMusic(MapFileUtil.mapID, "");
            SoundManager.instance.soundPlay(SoundTypeConst.Delivery);
            return;
        }
    }
